/*
 * @Description: 全宗reducer
 * @Author: Rfan
 * @Date: 2022-04-08 09:07:14
 * @LastEditTime: 2022-04-18 18:48:18
 */

import { SET_SELECT_DEPARTMENTS, SET_SELECT_USERS } from '../constants';

export const AddUserDialogReducer = (state, action) => {
  switch (action.type) {
    /**
     * @description: 表格加载loading
     */
    case SET_SELECT_DEPARTMENTS:
      return {
        ...state,
        selectDepartments: action.list
      };

    /**
     * @description: 设置选中的档案类型
     */
    case SET_SELECT_USERS:
      return {
        ...state,
        selectUsers: action.list
      };

    default:
      console.log('untouched', action);
      return state;
  }
};
